package D4;

import java.util.Arrays;

public class Java02 {
    public static void main(String[] args) {
        //选择排序
        int[] array = new int[]{3,7,2,8,9,23};
        //定义外部循环
        for (int i = 0; i < array.length - 1; i++) {
            for (int j = i + 1; j <array.length ; j++) {
                if (array[i] > array[j]){
                    int temp = array[i];
                    array[i] = array[j];
                    array[j] = temp;
                }
            }
        }
        System.out.println(Arrays.toString(array));
    }
}
